# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AppEngine.V1.Model.ResourceEvent do
  @moduledoc """
  The request that is passed to CLH during per-resource events. The request will be sent with update semantics in all cases except for data governance purge events. These events will be sent with delete semantics and the CLH is expected to delete the resource receiving this event.

  ## Attributes

  *   `eventId` (*type:* `String.t`, *default:* `nil`) - The unique ID for this per-resource event. CLHs can use this value to dedup repeated calls. required
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the resource for which this event is. required
  *   `state` (*type:* `GoogleApi.AppEngine.V1.Model.ContainerState.t`, *default:* `nil`) - The state of the project that led to this event.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :eventId => String.t() | nil,
          :name => String.t() | nil,
          :state => GoogleApi.AppEngine.V1.Model.ContainerState.t() | nil
        }

  field(:eventId)
  field(:name)
  field(:state, as: GoogleApi.AppEngine.V1.Model.ContainerState)
end

defimpl Poison.Decoder, for: GoogleApi.AppEngine.V1.Model.ResourceEvent do
  def decode(value, options) do
    GoogleApi.AppEngine.V1.Model.ResourceEvent.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AppEngine.V1.Model.ResourceEvent do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
